package com.guanyua.eims.controller;


import com.guanyua.eims.common.util.RestUtil;
import com.guanyua.eims.pojo.Rest;
import com.guanyua.eims.pojo.salegoods.PurchaseGoodsAddForm;
import com.guanyua.eims.service.PurchaseGoodsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 任建波
 * @since 2020-10-18
 */
@Api(tags = "采购-商品")
@RestController
@RequestMapping("/purchase-goods")
@Validated
@Slf4j
public class PurchaseGoodsController {

    @Autowired
    PurchaseGoodsService purchaseGoodsService;

    @ApiOperation(value = "采购商品")
    @PostMapping(value = "purchase-goods")
    public Rest purchaseGoods(@Valid @RequestBody PurchaseGoodsAddForm form) {
        purchaseGoodsService.purchaseGoods(form);

        return RestUtil.success();
    }

}

